
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>登录</title>
<link rel="stylesheet" href="/public/styles/base.css"/>
<link rel="stylesheet" href="/styles/login.css"/>
    <link rel="stylesheet" href="/css/new.css"/>
</head>
<body class="bg00">
<!--div.container 总外框  start-->
<div class="z_container bg02">
<!--    <header class="z_header">-->
<!--        <a id="return_url" target="_top" href="--><!--"></a>-->
<!--        <span style="font-size: 18px;font-weight: bold;color: #333333">登录</span>-->
<!--    </header>-->
    <div style="width: 100%;height: 1px;background: #f4f4f4;"></div>
    <!--div.z_min 内容区域 statr-->
    <div class="z_main" data-role="conent">
        <form class="user_form">
            <div style="margin-top: 40px;">
                <img src="/picture/icon_16.png" alt="">
                <input type="text" id="username" placeholder="用户名"/>
            </div>
            <div style="width: 100%;height: 1px;background: #f4f4f4;"></div>
            <div style="margin-top: 40px;">
                <img style="width: 12px;" src="/picture/icon_17.png" alt="">
                <input type="password" id="password" placeholder="密码"/>
            </div>
            <div style="width: 100%;height: 1px;background: #f4f4f4;"></div>
            <div style="margin-top: 40px;">
            <a href="javascript:void(0)" class="login_btn" style="float: left">登录</a>
            <a target="_top" href="/user/register.html?fwd=/user/user.html" class="register_btn" style="float: right;color: #333333;border:1px solid rgba(224,223,223,1); background:linear-gradient(0deg,rgba(231,231,231,1) 0%,rgba(255,255,255,1) 100%);">注册</a>
            </div>
        </form>
        <div style="clear: both"></div>
        <section class="login_nav">
<!--            -->            <nav>
<!--                <span class="split_h"></span>-->
<!--                <a href="javascript:void(0)" class="left_btn" id="wx_login">-->
<!--                    <i class="logos phone_login"></i><span>手机登录</span>-->
<!--                </a>-->
                                                    <div style="margin-top: 40px;">
                        <p style="font-size: 15px;color: #999999">其他登录方式：</p>
                        <a target="_top" href="#" class="left_btn">
                            <img style="width: 100%" src="/picture/icon_19.png" alt="">
                        </a>
                    </div>

                
            </nav>
<!--            -->        </section>
        
<!--        <section class="bottom_btns">-->
<!--            <div class="box1">-->
<!--                <i id="login_auto" class="i_check"></i>-->
<!--                <label for="login_auto">下次自动登录</label>-->
<!--            </div>-->
<!--    		<div class="box2">-->
<!--<!--            	<a target="_top" href="/user/register.html--><!--<!--" class="btn_green2">注册账号</a>-->
<!--    		</div>-->
<!--<!--    		<div class="box3">-->
<!--<!--            	<a target="_top" href="/user/forget.html">找回密码</a>-->
<!--<!--    		</div>-->
<!--        </section>-->
        <div class="footer_padding"></div>
    </div>
    <!--div.z_min 内容区域 end-->
</div>
<!--div.container 总外框  end-->
<!--footer 底部 start-->
<footer id="footer" class="z_footer" style="">
    <nav>
        <a target="_top" href="/index.html" style="margin-left: 2%;" >
            <p class="img_1"><img src="/picture/home.png" alt=""></p>
            <p class="img_2"><img src="/picture/home1.png" alt=""></p>
            <span>首页</span>
        </a>
        <a target="_top" href="/game/type.html?tc=GM" >
            <p class="img_1"><img src="/picture/game.png" alt=""></p>
            <p class="img_2"><img src="/picture/game1.png" alt=""></p>
            <span>GM</span>
        </a>
        <a target="_top" href="/game/game.html?tc=rm" title="">
            <p class="img_1"><img src="/picture/game.png" alt=""></p>
            <p class="img_2"><img src="/picture/game1.png" alt=""></p>
            <span>BT</span>
        </a>
        <a target="_top" href="/user/user.html" title="" id="footer_nav_active">
            <p class="img_1"><img src="/picture/user.png" alt=""></p>
            <p class="img_2"><img src="/picture/user1.png" alt=""></p>
            <span>我的</span>
        </a>
    </nav>
</footer>
<link href="/css/app.css" rel="stylesheet" type="text/css">
<div id="weixin_an" style="display: none">
    <div class="click_opacity"></div>
    <div class="to_btn">
        <span class="span1"><img src="/public/channel/click_btn.png"></span>
        <span class="span2"><em>1</em> 点击右上角<img src="/public/channel/menu_android.png">打开菜单</span>
        <span class="span2 android_open"><em>2</em> 选择<img src="/public/channel/android.png"></span>
        <span class="span2 android_open"><em>3</em> 重新登录账号充值</span>
    </div>
</div>
<!--二维码-->
<script src="/public/scripts/jquery-1.11.1.min.js"></script>
<script src="/public/scripts/jquery.qrcode.min.js"></script>

<!--<div class="qrcode_image">-->
<!--        <img src="/qrcode/game.html?addr=--><!--">-->
<!--</div>-->
<script>

    /**
     * 统计
     */
    function countDownload(obj,appid){
        // $.post("/index/game/countgame",{game_id:game_id},function(result){
        //     console.log(result);
        // });
        var ua = navigator.userAgent.toLowerCase();
        if (/iphone|ipad|ipod/.test(ua)) {
            if (appid == 100) {
                $(obj).attr('href', '#');
                alert('苹果手机不能下载安卓包哦，请选择h5游戏玩。');
                return;
            }
        } else if (/android/.test(ua)) {
            if (appid == 101) {
                $(obj).attr('href', '#');
                alert('安卓手机不能下载苹果包哦！');
                return;
            }
        if (ua.match(/MicroMessenger/i) == "micromessenger") {
            $(obj).attr('href', '#');
            $('#weixin_an').show();
            }
        }
    };
    // var is_weixin = (function(){return navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1})();
    // window.onload = function() {
    //     if (is_weixin) {
    //         $('#weixin_an').show();
    //     }
    // }
</script>

<script src="/public/scripts/jquery-1.11.1.min.js"></script>
<script src="/public/scripts/jquery.mobile.min.js"></script>

<script>
 
     function GetQueryString(name)
   {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)return  unescape(r[2]); return null;

   }

$('#footer a:eq(5)').attr('id', 'footer_nav_active');
$(function(){
	$('.user_form input').focus(function(){
		$('#footer').hide();
	}).blur(function(){
		$('#footer').show();
	});

	// $(".i_check").on("tap", function(){
    //     $(this).toggleClass("selected");
    //     remember = $(this).hasClass("selected") ? 1 : 0;
    // });
    $('label[for]').on('tap', function(){
        $(this).prev().trigger('tap');
    });

    var remember = GetQueryString("fwd");
	var loading = false;
	$('a.login_btn').on('tap', function(){
		if( loading ) return false;
		var u = $.trim($('#username').val());
		if( u == '' ) {
			alert('请输入你的用户名！');
			$('#username').focus();
			return false;
		}
		var p = $.trim($('#password').val());
		if( p == '' ) {
			alert('请输入你的密码！');
			$('#password').focus();
			return false;
		}
		loading = true;
		$.ajax({
	        type: 'POST',
	        url: '/user/ajaxlogin.html',
	        data: 'username='+u+'&password='+p+'&remember='+remember+'&type=login',
	        dataType: 'json',
	        success: function(data){
	            console.log('data',data);
			 if(data.info!='success'){
               if(data.fwd!=''){
               loading = false;
               alert(data.info);location.href=data.fwd;
               }else{
               loading = false;
               alert(data.info);
               }
             }else{
               if(data.fwd!=''){
               location.href=data.fwd;
               }else{
               location.href='/user/user.html';
               }
             }
	        },
	        error: function(){
	        	loading = false;
	        	alert('网络连接失败！');
	        }
	    });
	});

	$('#wx_login').on('tap', function(){
	    alert('正在开发，敬请期待！');
	    return false;
		// if( navigator.userAgent.indexOf('MicroMessenger') == -1 ) {
		// 	alert('请在微信中打开此页面，再使用微信登录功能！');
		// } else {
		//	location.href = '/user/wxlogin.html//';
		// }
	});

	var err = '';
	if( err != '' ) alert(err);
});
</script>

</body>
</html>